package com.app.fooddb.dao;

import com.app.fooddb.pojo.Foods;
import com.app.fooddb.pojo.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UsersMapper {
    @Select("select * from t_users where telephone=#{telephone} and password=#{password}")
    public Users login(@Param("telephone") String telephone,@Param("password") String password);

    @Insert("insert into t_users values(null,#{telephone},#{password})")
    public int register(Users users);

    @Select("select * from t_foods")
    public List<Foods> list();
    @Select("select * from t_foods where id=#{id}")
    public Foods findById(@Param("id") Integer id);
}
